package com.gupaoedu.pattern.factory.simplefactory;

import com.gupaoedu.pattern.factory.Bread;
import com.gupaoedu.pattern.factory.IFood;
import com.gupaoedu.pattern.factory.Milk;

/**
 * 2019/5/4
 * created by chenpp
 */
public class FoodFactory {
    public IFood productFood(String name){
        if("bread".equalsIgnoreCase(name)){
            return new Bread();
        }else if("milk".equalsIgnoreCase(name)){
            return new Milk();
        }
        return null;
    }
}
